package com.aidysoft.practice.log;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class LogDao {
    @Autowired
    JdbcTemplate jdbcTemplate;
@OperLog(message = "dao",operation = OperationType.ADD)
    public void add(SysPolice sysPolice) {
        jdbcTemplate.update("insert into t_syspolice values (?,?,?)",null,sysPolice.getName(),sysPolice.getPassword());
    }

    public void saveLog(SysLog sysLog) {
        jdbcTemplate.update("insert into log values (?,?,?)",null,sysLog.getMethod(),sysLog.getParams());
    }
}
